/*
using MyGeneration/Template/NHibernate (c) by lujan99@usa.net
*/
using System;
using System.Collections;
using System.Collections.Generic;

namespace OpenGado.DATA.Entities
{
	/// <summary>
	/// PurchaseOrderItems object for NHibernate mapped table 'purchase_order_items'.
	/// </summary>
	[Serializable]
	public class PurchaseOrderItems
	{
		#region Member Variables
		protected int _poitemid;
		protected PurchaseOrders _purchaseorders;
		protected Product _product;
		protected decimal? _quantity;
		protected decimal? _quantityreceived;
		protected string _receivedstatus;
		protected decimal? _purchaseprice;
		protected Vendor _vendor;
		#endregion
		#region Constructors
			
		public PurchaseOrderItems() {}
					
		public PurchaseOrderItems(PurchaseOrders purchaseorders, Product product, decimal? quantity, decimal? quantityreceived, string receivedstatus, decimal? purchaseprice) 
		{
			this._purchaseorders= purchaseorders;
			this._product= product;
			this._quantity= quantity;
			this._quantityreceived= quantityreceived;
			this._receivedstatus= receivedstatus;
			this._purchaseprice= purchaseprice;
		}

		public PurchaseOrderItems(PurchaseOrders purchaseorders, Product product)
		{
			this._purchaseorders= purchaseorders;
			this._product= product;
		}
		
		#endregion
		#region Public Properties
		public int PoItemId
		{
			get { return _poitemid; }
			set {_poitemid= value; }
		}
		public PurchaseOrders PurchaseOrders
		{
			get { return _purchaseorders; }
			set {_purchaseorders= value; }
		}
		public Product Product
		{
			get { return _product; }
			set {_product= value; }
		}
		public decimal? Quantity
		{
			get { return _quantity; }
			set {_quantity= value; }
		}
		public decimal? QuantityReceived
		{
			get { return _quantityreceived; }
			set {_quantityreceived= value; }
		}
		public string ReceivedStatus
		{
			get { return _receivedstatus; }
			set {_receivedstatus= value; }
		}
		public decimal? PurchasePrice
		{
			get { return _purchaseprice; }
			set {_purchaseprice= value; }
		}
		public Vendor Vendor
		{
			get { return _vendor; }
			set {_vendor= value; }
		}
		#endregion
		
		#region Equals And HashCode Overrides
		/// <summary>
		/// local implementation of Equals based on unique value members
		/// </summary>
		public override bool Equals( object obj )
		{
			if( this == obj ) return true;
			if( ( obj == null ) || ( obj.GetType() != this.GetType() ) ) return false;
			PurchaseOrderItems castObj = (PurchaseOrderItems)obj;
			return ( castObj != null ) &&
			this._poitemid == castObj.PoItemId;
		}
		/// <summary>
		/// local implementation of GetHashCode based on unique value members
		/// </summary>
		public override int GetHashCode()
		{
			int hash = 57;
			hash = 27 * hash * _poitemid.GetHashCode();
			return hash;
		}
		#endregion
		
	}
}
